﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>区信息管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="/hdocs/css/cms.css" rel="stylesheet" type="text/css" />
<script src="/hdocs/js/cms.js" type="text/javascript"></script>
<script src="/hdocs/js/prototype.js" type="text/javascript"></script>
<script src="/hdocs/js/region.js" type="text/javascript"></script>
</head>
<body style="padding: 10px">
	<form id="mainForm" name="mainForm" action="/region/areaAdd.jsp"
		method="post">
		<table class="formlist">
			<tr>
				<th width="80px">所属省:</th>
				<td>
					<select name="province" id="province" onchange="setCitys(this)">
						<option value="">---请选择---</option> 
						#foreach($pro in $provinceList)
						<option value="$pro.name" #if($pro.name==$province) selected #end>$pro.name</option>
						#end
					</select>
				</td>
			</tr>
			<tr>
				<th width="80px">所属市:</th>
				<td>
					<select name="city" id="city">
						<option value="">---请选择---</option>
					</select>
				</td>
			</tr>
			<tr>
				<th colspan="2">区（镇）名称:</th>
			</tr>
			<tr>
				<td colspan="2">
					<textarea name="areas" id="areas" cols="50" rows="15"></textarea>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<p class="wran">注：每行输入一个区（镇）名称，以回车键进行分割。</p></td>
			</tr>
			<tr>
				<td style="text-align: right" colspan="2">
					<input type="button" class="cms_button" onclick="submitFrom()" value="提交" /> 
					<input type="button" class="cms_button" onclick="resetForm()" value="重置" />
					<input type="button" class="cms_button" onclick="window.location.href='/region/areaQuery.jsp'" value="区镇列表" />
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
<script type="text/javascript">
<!--
	function submitFrom() {
		var province = document.getElementById("province");
		if (province.value == null || province.value == "") {
			alert("请选择省份！");
			return;
		}
		var city = document.getElementById("city");
		if (city.value == null || city.value == "") {
			alert("请选择城市！");
			return;
		}
		var areas = document.getElementById("areas");
		if (areas.value == null || areas.value == "") {
			alert("请填写区（镇）！");
			return;
		}
		var mainForm = document.getElementById("mainForm");
		mainForm.submit();
	}

	function resetForm() {
		document.getElementById("province").value = ""
		document.getElementById("city").value = ""
		document.getElementById("areas").value = ""
	}
//-->
</script>
